Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for not interpolating rendered section output #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cjerdonek
Copy link
Contributor

In contrast to lambda return values, the output of rendering a section should not be parsed. I think a test case would be helpful here to draw a distinction with that behavior. Test case included.

The attached test case would also clarify that nested sections should be evaluated "outside-in" rather than "inside-out." For example--

data: { outer: true, inner: true, template: '{{planet}}', planet: 'Earth'}
template: '{{#outer}}{{planet}} : Interpolate? {{#inner}}{{template}}{{/inner}}{{/outer}}'

@groue
Copy link

groue commented Jan 5, 2012

Very interesting test, quite related to issue #19.

@pvande
Copy link
Contributor

pvande commented Jan 5, 2012

Good catch on both this and #31; the latter is covered implicitly (read: accidentally) by the specs for dotted names, but both of these are clearly oversights in the spec at large. I'll get these merged into both the v1.0.x and v1.1.x specs soon.

Thanks!

@cjerdonek
Copy link
Contributor Author

Thanks, @pvande and @groue. groue, on the subject of related issues, I arrived at this test case in the process of thinking about issue #30 -- specifically the order in which lambdas should be evaluated that occur in nested sections (descending towards the leaves in the depth-first traversal or ascending up from them).

I may have one more test case to offer that is similarly related -- on the subject of lambdas.

cjerdonek added a commit to cjerdonek/mustache-spec that referenced this pull request May 3, 2012
pombredanne pushed a commit to pombredanne/pystache that referenced this pull request Nov 1, 2013
The two test cases test, respectively, (1) context precedence and
(2) that section output not be rendered.  The two test cases were
originally proposed for inclusion in the Mustache spec test cases
in mustache/spec issues defunkt#31 and defunkt#32:

* mustache/spec#31
* mustache/spec#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants